Class Specialization
Class Pool Allocator
Allocator that pools memory blocks for a specific class.
Allocator
Allocator
Class Pool Allocator
Allocator< ClassPool<Class, Type, ParentAllocator> >
Parameters
Class
The class.
Type
A specialization. The Class Pool Allocator can manage either slices of a fixed size or of
ParentAllocator
An allocator that is by the pool allocator used to allocate memory.
Note: The multi pool allocator only supports clear if this function is also implemented for ParentAllocator.
Specialization of
Implements
Functions
allocateAllocates memory from heap. (Allocator)
clearDeallocates all memory blocks. (Allocator)
deallocateDeallocates memory. (Allocator)
Remarks
A pool allocator allocates several memory blocks at once. Freed blocks are not immediately deallocated but recycled in subsequential allocations. This way, the number of calls to the heap allocator is reduced and that speeds up memory management. The Class Pool Allocator pools only memory blocks of a fixed size, namely sizeof(Class). The Class Pool Allocator only pools the memory, constructor and destructor have to be called manually.
Example Programs
SeqAn - Sequence Analysis Library - www.seqan.de